package com.company;

//Tomcat是满足Servlet规范的容器
//servlet基类
public abstract class MyServlet{

    public abstract void doGet(MyRequest myRequest,MyResponse myResponse);

    public abstract void doPost(MyRequest myRequest,MyResponse myResponse);

    public void service(MyRequest myRequest,MyResponse myResponse){
        //if(myRequest.getUrl().equalsIgnoreCase("/favicon.ico")) return;
        if(myRequest.getMethod().equalsIgnoreCase("POST")){
            doPost(myRequest,myResponse);
        }else if(myRequest.getMethod().equalsIgnoreCase("GET")){
            doGet(myRequest,myResponse);
        }
    }

}
